<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ page import="java.util.*"%>
<%@ page import="java.text.SimpleDateFormat"%>
<%@ page import="shop_board.db.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%
	//System.out.println(request.getAttribute("listcount")+" "+request.getAttribute("page")+" "+request.getAttribute("maxpage")+" " +request.getAttribute("startpage")+" "+request.getAttribute("endpage"));

	List boardList = null;
	int listcount = 1;
	int nowpage = 1;
	int maxpage = 1;
	int startpage = 1;
	int endpage = 1;
	

	if (request.getAttribute("listcount") == null) {
		response.sendRedirect("./Main_BoardList.sh");
	} else {
		boardList = (List) request.getAttribute("boardlist");
		listcount = ((Integer) request.getAttribute("listcount"))
				.intValue();
		nowpage = ((Integer) request.getAttribute("page")).intValue();
		maxpage = ((Integer) request.getAttribute("maxpage"))
				.intValue();
		startpage = ((Integer) request.getAttribute("startpage"))
				.intValue();
		endpage = ((Integer) request.getAttribute("endpage"))
				.intValue();
%>

<%
    int pageSize = 3;
    SimpleDateFormat sdf = 
        new SimpleDateFormat("yyyy-MM-dd");


    String pageNum = request.getParameter("pageNum");
    if (pageNum == null) {
        pageNum = "1";
    }

    int currentPage = Integer.parseInt(pageNum);
    int startRow = (currentPage - 1) * pageSize + 1;
    int endRow = currentPage * pageSize;
    int count = 0;
    List photolist = null;
    
    
    
    %>


<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>shopping your dream</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="default.css" rel="stylesheet" type="text/css" />

<link rel="stylesheet"
	href="http://www.blueb.co.kr/SRC/javascript/package/lightbox203/css/lightbox.css"
	type="text/css" media="screen" />

<script language="javascript" type="text/javascript"
	SRC="../harvest/harvest.js">
</script>

<script
	src="http://www.blueb.co.kr/SRC/javascript/package/lightbox203/js/prototype.js"
	type="text/javascript"></script>
<script
	src="http://www.blueb.co.kr/SRC/javascript/package/lightbox203/js/scriptaculous.js?load=effects"
	type="text/javascript"></script>
<script
	src="http://www.blueb.co.kr/SRC/javascript/package/lightbox203/js/lightbox.js"
	type="text/javascript"></script>

</head>
<body>
<div id="logo-wrap">
<div id="logo">
<h1><a href="../harvest/index.jsp">Shop </a></h1>
<h2>Design your dream</h2>
</div>
<div>
  <ul>
	<li id="search">
	<form method="get" action="">
	<fieldset><input type="text" id="s" name="s" value="" /> <input
		type="submit" id="x" value="Search" /></fieldset>
	</form>
	</li>
	</ul>
</div>
</div>
<!-- start header -->
<div id="header">
<div id="menu">
<ul id="tabSubmenu">
	<li><a href="#">SHOP</a>
	<ul>
		<li><a href="../web/shop/shop_shop/BoardList.sh">top</a></li>
        <li><a href="../web/shop/shop_shop/BoardListPants.sh">pants</a></li>
        <li><a href="../web/shop/shop_shop/BoardListOnepice.sh">onepice</a></li>
        <li><a href="#">out</a></li>
        <li><a href="#">skirt</a></li>
        <li><a href="#">bag</a></li>
        <li><a href="#">etc</a></li>
	</ul>
	</li>
	<li><a href="#">TO OFFER</a>
	<ul>
		<li><a href="../web/admin/shop_offer/list.jsp">trend</a></li>
		<li><a href="#">style</a></li>
	</ul>
	</li>
	<!-- 
	<li><a href="#">COMMUNITY</a>
	
	<ul>
		<li><a href="./board/qna_board_list.jsp">패션제안</a></li>
		<li><a href="./board/hot_girl_list.jsp">Hot girl</a></li>
	</ul>
	</li>
	-->
</ul>

<ul>
	<li><a href="../qna/indexMain.jsp">Q & A</a></li>
	<li><a href="#">MYPAGE</a></li>
	<li><a href="#">CART</a></li>
	<li class="current_page_item"><a href="../login.jsp"> <%
 	String sessionId = (String) session.getAttribute("shop_id");
 		if (sessionId == null) {
 %> LOG IN <%
 	} else {
 %> <%=sessionId%> LOG OUT <%
 	}
 %>
	</a></li>
	<li class="last"><a href="../join.jsp"> <%
 	if (sessionId == null) {
 %> JOIN US <%
 	} else {
 %> 
 <%
 	}
 %> </a></li>
</ul>
</div>
</div>
<!-- end header -->
<!-- start page -->
<div id="wrapper">
<div id="wrapper-btm">
<div id="page"><!-- start content -->
<div id="content">
<div id="banner"></div>
<div class="post">
<h1 class="title" align="center">pick up take home</h1>
<div class="entry">
<p>
<div id="imageFlow">
<div class="top"></div>
<div class="bank"><a
	href="C:/image/2010-07-19 17;27;24.jpg"
	title="벚꽃">1</a> <a
	href="C:/image/2010-07-19 17;27;37.jpg"
	title="치즈케익">2</a> <a
	href="C:/image/2010-07-19 17;27;47.jpg"
	title="한강유람선">3</a> <a
	href="C:/image/2010-07-19 17;27;55.jpg"
	title="New life">4</a> <a
	href="C:/image/2010-07-19 17;28;02.jpg"
	title="BMW M5">5</a> <a
	href="C:/image/2010-07-19 17;28;10.jpg"
	title="Empathy">6</a> <a
	href="C:/image/2010-07-19 17;28;21.jpg"
	title="Much work">7</a></div>
<div class="text">
<div class="title">Loading</div>
<div class="legend">Please wait...</div>
</div>
<div class="scrollbar"><img class="track"
	src="" alt="">
<img class="arrow-left"
	src="" alt="">
<img class="arrow-right"
	src="" alt="">
<img class="bar"
	src="" alt="">
</div>
</div>
</p>
</div>
<div class="meta">
<p class="byline">Posted on July 21, 2007 byFreeCssTemplates</p>
<p class="links"><a href="#" class="more">Read full article</a> <b>|</b>
<a href="#" class="comments">Comments (32)</a></p>
</div>
<table align="center">
<tr>
<td>
<a href="C:/image/2010-07-19 17;27;24.jpg"
	rel="lightbox[roadtrip]"><img
	src="C:/image/2010-07-19 17;27;24.jpg" width=100
	border=0></a> <a
	href="C:/image/2010-07-19 17;27;47.jpg"
	rel="lightbox[roadtrip]"><img
	src="C:/image/2010-07-19 17;27;47.jpg" width=100
	border=0></a> <a
	href="C:/image/2010-07-19 17;28;10.jpg"
	rel="lightbox[roadtrip]"><img
	src="C:/image/2010-07-19 17;28;10.jpg" width=100
	border=0></a> <a
	href="C:/image/2010-07-19 17;27;55.jpg"
	rel="lightbox[roadtrip]"><img
	src="C:/image/2010-07-19 17;27;55.jpg" width=100
	border=0></a> <a
	href="C:/image/2010-07-19 17;28;02.jpg"
	rel="lightbox[roadtrip]"><img
	src="C:/image/2010-07-19 17;28;02.jpg" width=100
	border=0></a>
</td>
</tr>
</table>
</div>
</div>
<div id="sidebar">
<!-- end sidebar -->
<div style="clear: both;">&nbsp;</div>
</div>
<!-- end page --></div>
</div>
<!-- start footer -->
<div id="footer">
<div id="footer-wrap">
</div>
</div>
<!-- end footer -->
<!-- 여기는 shop 이미지부분-->
		<%

		for(int i = 0; i<boardList.size(); i++) {  
			BoardBean bl=(BoardBean)boardList.get(i);
			%>

<td align="center"><a href =./BoardDetailAction.sh?product_num=<%=bl.getNum()%>&pageNum=<%=currentPage%>>
<div align="center">
<img src="C:\shopdesign\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\shopping mall\boardupload\<%=bl.getBoard_file() %>"width="100" height="100" /><BR><%=bl.getWriter() %></div>
	</td>

</a><br/>
<td style="font-family:Tahoma;font-size:10pt;">
			<div align="left">
			<%if(bl.getLeve()!=0){ %>
				<%for(int a=0;a<=bl.getLeve()*2;a++){ %>
				&nbsp;
				<%} %>
				▶
			<%}else{ %>
				▶
			<%} %>
			<a href="./BoardDetailAction.sh?product_num=<%=bl.getNum()%>">
				
				
			</a>
			</div>
		</td>
<%
if(i==4){ 
	%>
<tr><td height="9"></td></tr>
<%
}
} 
%>
</tr>
<%}%>
</table>

<center>



<%
int count=0;
int pageSize = 4;

String pageNum = request.getParameter("pageNum");
if (pageNum == null) {
    pageNum = "1";
}
int currentPage = Integer.parseInt(pageNum);
    if (count > 0) {
        int pageCount = count / pageSize + ( count % pageSize == 0 ? 0 : 1);
         
        int startPage = (int)(currentPage/10)*10+1;
        int pageBlock=10;
        int endPage = startPage + pageBlock-1;
        if (endPage > pageCount) endPage = pageCount;
        
        if (startPage > 10) {    %>
        <a href="kPhotoList.jsp?pageNum=<%= startPage - 10 %>"></a>
<%      }
        for (int i = startPage ; i <= endPage ; i++) {  %>
        <a href="kPhotoList.jsp?pageNum=<%= i %>"><%= i %></a>
<%
        }
        if (endPage < pageCount) {  %>
        <a href="kPhotoList.jsp?pageNum=<%= startPage + 10 %>"></a>
<%
        }
    }
%>
</center>
			
			
			
			
			


</body>
</html>